package cn.edu.ptu.jobfairs.basic.enums;

/**
 * @author wutingting.226@163.com
 * @date 2020/9/4
 */

public enum AdviseCode {

    REJECT(0, "不建议录用"),
    EMPLOY(1, "建议录用"),
    CONSIDER(2, "待定");

    private final int value;

    AdviseCode(int value, String desc) {
        this.value = value;
    }

    public static String nameOf(Integer value) {
        if (value == null) return "unknown";
        for (AdviseCode adviseCode: values()) {
            if (adviseCode.value == value) return adviseCode.name().toLowerCase();
        }
        return "unknown";
    }

    public static boolean exists(Integer value) {
        if (value == null) return false;
        for (AdviseCode adviseCode: values()) {
            if (adviseCode.value == value) return true;
        }
        return false;
    }
}
